import re

f=open('ttt.txt', 'r')
line=f.read()
#line="hogeh<TITLE>foo</TITLE>ogefugaf<TITLE>var</TITLE>uga"

r=re.compile('TITLE\>(.*?)\<\/TITLE')
print 'get...'
ts=r.findall(line)
print 'done'

print 'write...'
wf=open('tttti.txt','w')
i=0
for t in ts:
	wf.write(t + "\n")
	i+=1
	print i
print 'done'
